require('../util/mongodb');
const mongoose = require("mongoose");
const Base=require('./base')
const Schema=mongoose.Schema;


class User extends Base{

    constructor(schemaName){
        
        
        const userSchema=new Schema({
            name:{type :String,default:''},
            age:{type:Number},
            size:{type:Number},
            classType:{type:Number},
            date:{type:Date}
        });
        super(schemaName,userSchema);
        this.schemaName=schemaName;
    }
    
}
const myuser=new User('confBase');
// myuser.save('1001',{name:'abc',age:18,size:161,classType:10,date:new Date()}).then(console.log);
// myuser.save('1001',{name:'abc1',age:19,size:162,classType:11,date:new Date()}).then(console.log);
// myuser.save('1001',{name:'abc2',age:18,size:163,classType:12,date:new Date()}).then(console.log);
// myuser.save('1001',{name:'abc3',age:20,size:164,classType:13,date:new Date()}).then(console.log);
//myuser.findList('1001',{name:{$regex:/abc./, $options:'i'}},{},{sort:'age'}).then(console.log);
//myuser.findOneAndUpdate('1001',{_id:'640e8d37664bfc709eef8f14'},{name:'abc1234'},{new:true}).then(console.log);
//myuser.deleteOne('1001',{_id:'640e8d37664bfc709eef8f14'},{}).then(console.log);
//myuser.save('1004',{name:'bac1',age:19});
module.exports=myuser;